package com.langll.ai.minio.model;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author langll2
 * @since 2025-04-11
 */
@TableName("ai_document_file")
public class AiDocumentFile implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    private String name;

    private long size;

    private String fileObjectName;

    private String fileObjectUrl;

    private String vectorState;

    /**
     * Operator
     */
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String modifier;

    /**
     * Create Time
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * Update Time
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getFileObjectName() {
        return fileObjectName;
    }

    public void setFileObjectName(String fileObjectName) {
        this.fileObjectName = fileObjectName;
    }

    public String getFileObjectUrl() {
        return fileObjectUrl;
    }

    public void setFileObjectUrl(String fileObjectUrl) {
        this.fileObjectUrl = fileObjectUrl;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getVectorState() {
        return vectorState;
    }

    public void setVectorState(String vectorState) {
        this.vectorState = vectorState;
    }

    public UploadFileVo toUploadFileVo(){

        return new UploadFileVo()
                .setId(this.id.longValue())
                .setName(this.name)
                .setSize(this.size)
                .setFileObjectName(this.fileObjectName)
                .setUrl(this.fileObjectUrl)
                .setVectorState(this.vectorState)
                .setCreateTime(this.createTime)
                .setUpdateTime(this.updateTime);
    }

    @Override
    public String toString() {
        return "AiDocumentFile{" +
        "id = " + id +
        ", name = " + name +
        ", size = " + size +
        ", fileObjectName = " + fileObjectName +
        ", fileObjectUrl = " + fileObjectUrl +
        ", creator = " + creator +
        ", modifier = " + modifier +
        ", createTime = " + createTime +
        ", updateTime = " + updateTime +
        "}";
    }
}
